home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / mips-sgi-irix6.2 / tm-image.z / tm-image
Encoding:
Text File  |  1998-05-21  |  1.7 KB  |  72 lines

  1. #!/bin/sh -
  2. #
  3. # $Id: tm-image,v 2.0 1997/01/10 14:42:48 morioka Exp $
  4. #
  5. # Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
  6.  
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2, or (at your option)
  10. # any later version.
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15. # You should have received a copy of the GNU General Public License
  16. # along with GNU Emacs; see the file COPYING.  If not, write to the
  17. # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. # Boston, MA 02111-1307, USA.
  19.  
  20. PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
  21.  
  22. if [ "$TM_TMP_DIR" = "" ]; then
  23.     TM_TMP_DIR=/tmp
  24.     export TM_TMP_DIR
  25. fi
  26. if [ "$5" = "" ]; then
  27.     case "$2" in
  28.     "image/gif")
  29.         filename="$TM_TMP_DIR/mime$$.gif"
  30.         ;;
  31.     "image/jpeg")
  32.         filename="$TM_TMP_DIR/mime$$.jpg"
  33.         ;;
  34.     "image/tiff"|"image/x-tiff")
  35.         filename="$TM_TMP_DIR/mime$$.tif"
  36.         ;;
  37.     "image/x-xwd")
  38.         filename="$TM_TMP_DIR/mime$$.xwd"
  39.         ;;
  40.     "image/x-xbm")
  41.         filename="$TM_TMP_DIR/mime$$.xbm"
  42.         ;;
  43.     "image/x-pic")
  44.         filename="$TM_TMP_DIR/mime$$.pic"
  45.         ;;
  46.     "image/x-mag")
  47.         filename="$TM_TMP_DIR/mime$$.mag"
  48.         ;;
  49.     *)
  50.         filename="$TM_TMP_DIR/mime$$.img"
  51.         ;;
  52.     esac
  53. else
  54.     filename="$TM_TMP_DIR/$5"
  55. fi
  56.  
  57. echo "$2; $3 -> $filename"
  58.  
  59. tmdecode $3 $1 $filename
  60.  
  61. case "$4" in
  62. "play")
  63.     xv -geometry +1+1 $filename
  64.     trap 'rm -f $filename' 0 1 2 3 13 15
  65.     ;;
  66. "extract")
  67.     echo "extract to $filename"
  68.     ;;
  69. esac
  70.